NestJS ships a named exception class for every common HTTP error status. All extend HttpException. The most commonly used are BadRequestException (400), UnauthorizedException (401), ForbiddenException (403), NotFoundException (404), ConflictException (409), UnprocessableEntityException (422), and InternalServerErrorException (500).
BadRequestException — 400
UnauthorizedException — 401
PaymentRequiredException — 402
ForbiddenException — 403
NotFoundException — 404
MethodNotAllowedException — 405
NotAcceptableException — 406
RequestTimeoutException — 408
ConflictException — 409
GoneException — 410
UnprocessableEntityException — 422
TooManyRequestsException — 429
InternalServerErrorException — 500
NotImplementedException — 501
BadGatewayException — 502
ServiceUnavailableException — 503
GatewayTimeoutException — 504